package com.zlp.boot1.config;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author: zhulaiping
 * @Date: 2021/9/29 16:37
 */
@Component
public class DefectFcousListener implements ApplicationListener {
    @Override
    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        if(applicationEvent instanceof DefectFcousEvent){
            DefectFcousEvent defectFcousEvent = (DefectFcousEvent)applicationEvent;

            Integer age = defectFcousEvent.getAge();
            String name = defectFcousEvent.getName();

            System.out.println("age " +age +" name " +name);
        }
    }
}
